<?php
/* @var $this CmpTemplatesController */
/* @var $model CmpTemplates */
/* @var $form CActiveForm */
?>

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'cmp-templates-form',
	'enableAjaxValidation'=>false,
	'htmlOptions'=>array('class'=>'template_box')
)); ?>

	<ul class="form_list form_list2 mt10">
		<li class="title">
			<span class="fs_14 fw_b"><?php echo $model->isNewRecord?'添加模板':'修改模板'?></span>
		</li>
		<li class="c_f"><span class="tit">模板名称：</span>
			<div class="cont f_l">
				<?php echo $form->textField($model,'zct_title',array('class'=>'t_ipt w_250')); ?>
				<?php echo $form->error($model,'zct_title'); ?>
			</div>
		</li>
		<li class="c_f"><span class="tit">模板目录：</span>
			<div class="cont f_l">
				<?php echo $form->textField($model,'zct_directory',array('class'=>'t_ipt w_250')); ?>
				<?php echo $form->error($model,'zct_directory'); ?>
			</div>
		</li>
		<li class="c_f"><span class="tit">使用类型：</span>
			<div class="cont f_l">
				<?php echo CHtml::activeDropDownList($model,'zmg_id',MemGroup::model()->getMemGroup(),array(
						'class'=>'i_ipt w_120',
						'size'=>'5',
						'empty'=>'请选择会员组',
						'ajax' =>array(
									'type'=>'GET',
									'url'=>CController::createUrl('cmpTemplates/getMemType'),
									'update'=>'#CmpTemplates_zmg_ids',
									'data'=>array('mid'=>"js:this.value")
									),
						))?>
				<?php echo $form->dropDownList($model,'zmg_ids',MemType::model()->getMemtype(),array('class'=>'i_ipt w_120','size'=>'5','empty'=>'选择会员等级','multiple'=>'multiple'))?>
			</div>
		</li> 
		<li class="c_f"><span class="tit">模板描述：</span>
			<div class="cont f_l">
				<?php echo $form->textArea($model,'zct_desc',array('class'=>'t_area'))?>
			</div>
		</li>
		<?php if(!$model->isNewRecord){?>
		<li class="c_f"><span class="tit">模板图片：</span>
			<div class="cont f_l">
				<div class="cont_img f_l"><?php echo CHtml::image($model->zct_directory.'/screenshot.jpg','',array('width'=>'101','width'=>'101'))?></div>
				<div class="cont_info f_l">
				</div>
			</div>
		</li>
		<?php }?>
		<li class="c_f"><span class="tit">是否默认：</span>
			<div class="cont f_l">
				<?php echo $form->radioButtonList($model,'zct_default',CmpTemplates::model()->getDefault(),array('labelOptions'=>array('class'=>'mr10'),'class'=>'radio'))?>
			</div>
		</li>
		<li class="c_f"><span class="tit">是否启用：</span>
			<?php echo $form->radioButtonList($model,'zct_status',CmpTemplates::model()->getStatus(),array('labelOptions'=>array('class'=>'mr10'),'class'=>'radio'))?>
		</li>
		<li class="c_f"><span class="tit">&nbsp;</span>
			<div class="cont f_l">
				<?php echo CHtml::submitButton($model->isNewRecord?Yii::t('adm','Save Date'):Yii::t('adm','Update Date'),array('class'=>'mem_btn mem_btn20 mr5'))?>
				<?php echo CHtml::resetButton(Yii::t('adm','Reset'),array('class'=>'mem_btn mem_btn07'))?>
			</div>
		</li>
	</ul>	

<?php $this->endWidget(); ?>
